package com.my.db.test.jpa;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author timo 2021/3/11
 */
@Service
@DS("mysql2")
public class EmployeeJpaService {
    @Autowired
    private EmployeeJpaRepository employeeRepository;


    public List<EmployeeJpa> findAll() {
        return employeeRepository.findAll();
    }

    public void save(EmployeeJpa employee) {
        employeeRepository.save(employee);
    }
}
